<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use DB;

class Login extends Model
{
	//用户注册
    public function add($arr){

        $data = DB::table('user')->insert($arr);
        return $data;
    }

	//登录，查询值
	public function login($user_name){
		$res = DB::table('user')->where('user_name',$user_name)->first();
		return $res;
	}
	//插入登录的时间和次数
	public function login_up($data,$user_id){
		$res = DB::table('user')->where('user_id',$user_id)->update($data);
		return $res;
	}
}

